<template>
  <div>
    <div class="block">
      <span class="demonstration">共{{total}}条</span>
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-size="pageSize"
        layout="total, prev, pager, next, jumper"
        :total="total"
      ></el-pagination>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    pageSize: {
      type: Number,
      default: 7
    },
    total: {
      type: Number,
      default: 0,
      required: true
    },
    currentPage: {
      type: Number,
      default: 1
    }
  },
  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      // console.log(`当前页: ${val}`);
      this.$emit('currentChange', val)
    }
  },
  data() {
    return {
    };
  },
  mounted() {
  }
};
</script>
<style lang="scss" scoped>
.block{
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.el-pagination /deep/ .el-pagination__total{
  display: none;
}
.demonstration{
  white-space: nowrap;
}
</style>